package com.sgb.kjwl.utils;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import androidx.core.util.Pair;

import com.alibaba.android.arouter.launcher.ARouter;
import com.jyb.qiyefuwu.router.PathHome;
import com.sgb.alimaplibrary.util.ToastUtil;
import com.sgb.auction.activity.AuctionManageActivity;
import com.sgb.auction.activity.AuctionPublishActivity;
import com.sgb.auction.activity.BiddingQueryActivity;
import com.sgb.capital.view.ui.activity.CapitalActivity;
import com.sgb.goods.utils.Constants;
import com.sgb.jicai.view.activity.FactoryJicaiActivity;
import com.sgb.jicai.view.activity.JcChanceListActivity;
import com.sgb.jicai.view.activity.JcMyPriceActivity;
import com.sgb.jicai.view.activity.MyCenterMyJoinActivity;
import com.sgb.jicai.view.activity.MyCenterXuFangFaQiActivity;
import com.sgb.jicai.view.activity.MyJicaiSupervisionActivity;
import com.sgb.kjwl.aspectj.login.LoginCheck;
import com.sgb.kjwl.model.entity.businessmanagement.CompanyEntity;
import com.sgb.kjwl.model.entity.self.PermissionMenuEntity;
import com.sgb.kjwl.view.ui.activity.EmptyNullActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.AddNeedListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ContanctsActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.MakeOverPublishMainActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.MySignUpListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ProfessionalTeamPictureActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.PublishServiceListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ServiceQuoteListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.TalentListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.TeamIntelligenceListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.UserCenterTeamDetailActivity;
import com.sgb.kjwl.view.ui.activity.leaseAsk.MyAskLeaseActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebSiteAddressActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebSiteGroupActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteMyXiXinActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteOrganizationActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteQiYeXiXinActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteReleaseActivity;
import com.sgb.kjwl.view.ui.activity.pick.PickExpertListActivity;
import com.sgb.kjwl.view.ui.activity.self.ApprovalManagerActvity;
import com.sgb.kjwl.view.ui.activity.self.CarManagerActivity;
import com.sgb.kjwl.view.ui.activity.self.JoinCompanyActivity;
import com.sgb.kjwl.view.ui.activity.self.LogisticsMenuActivity;
import com.sgb.kjwl.view.ui.activity.self.PersonInfoActivity;
import com.sgb.kjwl.view.ui.activity.self.authentication.AuthActivity3;
import com.sgb.kjwl.view.ui.activity.self.authentication.CertificationActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.BusinessOpportunitySubscriptionActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.CarriageManageActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.MyOfferActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.LeaseMemberListActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.SelfLeaseDemandListActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.SelfLeaseOrderListActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.AddCarActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.BiddingOrderActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.CargoManageActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.PublishCargoActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.IntelligentAttentionActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.LetterBackActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.MonitoringReportActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.SecondMoreActivity;
import com.sgb.kjwl.view.ui.activity.self.offer.TruckRegisterActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.LaborServiceAndEmploymentPublishListActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfEmploymentApplyActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfPackersManageActivity2;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamAchieveActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamAlbumActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamDeviceActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamEmploymentActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamGroupActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamIntroduceEditActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamMembersActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamOfferActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfWorkerPublishActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.GoodsListActivity3;
import com.sgb.kjwl.view.ui.activity.self.publish.GoodsPublishActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.PublicMyPriceListActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.SelfLeaseListActivity;
import com.sgb.kjwl.view.ui.activity.self.team.TeamFunctionActivity;
import com.sgb.kjwl.view.ui.activity.transport.AddSelfCarActivity;
import com.sgb.kjwl.view.ui.activity.transport.MainCitiesActivity;
import com.sgb.kjwl.view.ui.activity.transport.OwnerAndDriverInquiryActivity;
import com.sgb.kjwl.view.ui.activity.transport.SelfCarManagerActivity;
import com.sgb.kjwl.view.ui.activity.transport.company.FleetManagementActivity;
import com.sgb.kjwl.view.ui.activity.transport.driver.order.TransportOrderDriverActivity;
import com.sgb.kjwl.view.ui.activity.transport.owner.FreightCarTransportationActivity;
import com.sgb.kjwl.view.ui.activity.transport.owner.TransportOrderOwnerActivity;
import com.sgb.kjwl.view.widget.self.MenuClickUtils;
import com.sgb.link.router.PathDriver;
import com.sgb.link.router.PathGoods;
import com.sgb.link.router.PathLogin;
import com.sgb.link.router.PathLogistics;
import com.sgb.link.router.PathMerchant;
import com.sgb.link.router.PathTeam;
import com.sgb.link.router.PathTrip;
import com.sgb.member.ui.activity.MemberAuditActivity;
import com.sgb.member.ui.activity.MemberClientManageActivity;
import com.sgb.member.ui.activity.MemberDoorActivity;
import com.sgb.member.ui.activity.MemberInviteOrApplyActivity;
import com.sgb.member.ui.activity.MemberLeverSettingActivity;
import com.sgb.member.ui.activity.MemberManageActivity;
import com.sgb.member.ui.activity.RatingBusinessActivity;
import com.sgb.member.ui.activity.RemoveMemberActivity;
import com.sgb.zhaocai.view.activity.PickInvitedApplyListActivity;
import com.sgb.zhaocai.view.demand.activity.DemandIssueListActivity;
import com.sgb.zhaocai.view.demand.activity.OfferQueryListActivity;
import com.sgb.zhaocai.view.demand.activity.ProjectIssueListActivity;
import com.swgk.core.base.model.entity.RouterKey;
import com.swgk.core.dialog.RoundDialog;
import com.swgk.core.event.EventConstant;
import com.swgk.core.util.ACAdminDialogUtils;
import com.swgk.core.util.MToast;
import com.swgk.core.util.SharedPreferenceUtil;
import com.swgk.core.util.UiUtil;
import com.swgk.core.util.UserOperating;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class MineAdapterItemClick {
    private static MineAdapterItemClick mineAdapterItemClick;
    private UrlMapDataCallBack urlMapDataCallBack;
    private String from;
    public synchronized static   MineAdapterItemClick getInstance() {
        if (mineAdapterItemClick == null) {
            mineAdapterItemClick= new MineAdapterItemClick();
        }

        return mineAdapterItemClick;
    }
    //跳转
    public void adapterItemClick(PermissionMenuEntity.ListEntity entity, Context context) {
        this.from =from;
        int companyType = SharedPreferenceUtil.getInstance().getSaveIntData(SharedPreferenceUtil.COM_TYPE, SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, true) ? 1 : 0);
        if (!TextUtils.isEmpty(entity.getName())) {
            if (entity.getName().equals("19_jibenxinxi") || entity.getName().equals("19_jiaruqiye") || entity.getName().equals("26_zhanghuanquan")
                    || entity.getName().equals("18_renzhengzhongxin") || entity.getName().equals("18_erweimamingpian")
                    || entity.getName().equals("18_guanfangkefu") || entity.getName().equals("18_fenxiangapp")
                    || entity.getName().equals("18_yijianfankui") || entity.getName().equals("18_shezhi") || entity.getName().equals("0_gengduo")
                    ||  entity.getName().equals("20_wodezuzhi") || entity.getName().equals("5_jigongjizhang")) {
            } else {
                if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                    ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                    return;
                }
            }
            Log.e("message", entity.getName());
            switch (entity.getName()) {
                case "2_toubiaochaxun":  //个人
                case "3_toubiaochaxun":  //商品 ?type=3
                case "4_toubiaochaxun":  //租赁 ?type=1
                case "5_toubiaochaxun":  //工程 ?type=2
                case "7_toubiaochaxun":   //招采 投标查询
                    setUrlMapData("tenderList", entity);
                    break;
                case "2_jingjiacaigouchaxun":  // 个人- 竞价采购查询
                case "3_zhijiejingjiachaxun":  // 商品- 直接竞价查询
                case "4_jingjiachaxun":        // 租赁- 竞价查询
                case "5_jingjiachaxun":        // 工程- 竞价查询
                case "7_jingjiachaxun":        // 招采- 竞价查询
                    setUrlMapData("bidList", entity);
                    break;
                case "2_toubiaojiyu": //个人-投标机遇
                case "3_toubiaojiyu": //商品-投标机遇
                case "4_toubiaojiyu": //租赁-投标机遇
                case "5_toubiaojiyu": //工程-投标机遇
                case "7_toubiaojiyu": //招采-投标机遇
                    setUrlMapData("biddingInvite", entity);
                    break;
                case "2_jingjiajiyu": //个人-竞价机遇
                case "3_jingjiajiyu": //商品-竞价机遇
                case "4_jingjiajiyu": //租赁-竞价机遇
                case "5_jingjiajiyu": //工程-竞价机遇
                case "7_jingjiajiyu": //招采-竞价机遇
                    setUrlMapData("InviteProComp", entity);
                    break;
                case "2_zhaobiaobaomingshenqing": //个人-招标报名申请
                case "3_zhaobiaobaomingshenqing": //商品-招标报名申请
                case "4_zhaobiaobaomingshenqing": //租赁-招标报名申请
                case "5_zhaobiaobaomingshenqing": //工程-招标报名申请
                case "7_baomingshenqing": //招采-招标报名申请
                    setUrlMapData("biddingApplicationMas", entity);
                    break;
                case "2_zigeshencha": //个人-资格审查
                case "7_zigeshencha":
                    setUrlMapData("prequalification", entity);
                    break;
                case "2_woyaopingbiao": //个人-我要评标
                case "7_woyaopingbiao":
                    setUrlMapData("bidEvaluation", entity);
                    break;
                //我的询价
                case "2_wodexunjia":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.PERSONAL_MY_INQUIRY).navigation();
                    break;
                case "0_zijinzhongxin":
                    //   CapitalActivity.start(context, mType == 0);
                    break;
                case "2_wodebaojia":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.AR_SHOP_MY_PRICE).navigation();
                    break;
                case "2_wodehanxun"://我的函询
                    LetterBackActivity.start(context);
// TODO                   LeaseMyInquiryActivity.start(context);统一页面在LetterBackActivity里面加模块功能
                    break;
                case "2_wodehuifu"://我的回复
                    LetterBackActivity.start(context);
// TODO                    LeaseMyReplyActivity.start(context);统一页面在LetterBackActivity里面加模块功能
                    break;
                case "2_wodejubao"://我的举报
                    MonitoringReportActivity.start(context);
// TODO             统一页面在MonitoringReportActivity里面加模块功能
                    break;
                case "2_wodejiandu"://我的监督
                    MonitoringReportActivity.start(context);
// TODO             统一页面在MonitoringReportActivity里面加模块功能
                    break;
                    /*
                    商品经营
                     */
                case "3_caigoudingdan":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.AR_PURCHASE_ORDER_LIST).navigation();
                    break;
                case "3_xiaoshoudingdan":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.AR_SELL_ORDER_LIST).navigation();
                    break;
                case "3_shangpinfabu":
                    GoodsPublishActivity.start(context);
                    break;
                case "3_shangpinbaojia":
                    GoodsListActivity3.start(context);
                    break;

                case "3_huiyuanjiaguanli"://会员价管理商品列表
                    com.swgk.core.common.utils.ActivityJump.startActivity(PathGoods.VipPriceManageActivity);
                    break;
                case "3_cangchuguanli":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.AR_STORAGE_MANAGER).navigation();
                    break;
                case "2_pingpaijingying":
                case "3_pinpaiguanli":
                    ARouter.getInstance().build(com.sgb.goods.utils.Constants.ARouter.AR_BRAND_MANAGER).navigation();
                    break;

                case "3_piliangtiaojia":
                case "3_zhudongbaojia":
                case "2_pingpaihuafen":
                    EmptyNullActivity.statractivity(context, entity.getTitle());
                    break;

                /*
                租赁经营
                 */
                case "4_zulinfabu":
                    SelfLeaseListActivity.start(context);
                    break;
                case "4_wodebaojia":
                    PublicMyPriceListActivity.start(context, "0");
                    break;
                case "4_wodeqiuzu":
                    MyAskLeaseActivity.start(context);
                    break;
                case "4_qiuzudingdan": // 求租订单
                    SelfLeaseOrderListActivity.start(context, "1");
                    break;
                case "4_chuzudingdan": //出租订单
                    SelfLeaseOrderListActivity.start(context, "2");
                    break;
                case "4_kehubaojia": //客户报价
                    PublicMyPriceListActivity.start(context, "1");
                    break;
                case "4_kuaijiexuqiu": //快捷需求
                    SelfLeaseDemandListActivity.start(context);
                    break;
                case "4_zlhuiyuanjiaguanli"://会员价管理
                    LeaseMemberListActivity.start(context);
                    break;
                    /*
                      招采经营
                     */
                case "7_zhaobiaofabu":
//                    UserBidPublishActivity.start(context);
                    MToast.showToast(context, "移动端不支持招标发布，请前往电脑端“经营帮/用户中心/招采经营”发布");
                    break;
                case "7_baojiachaxun":
                    //  BidQuoteActivity.start(context, 1);
                    OfferQueryListActivity.start(context);
                    break;
                case "7_zhaobiaoliebiao":
                    setUrlMapData("tenter", entity);
                    break;
                case "7_jingjiafabu":
                    MToast.showToast(context, "移动端不支持竞价发布，请前往电脑端“经营帮/用户中心/招采经营”发布");
                    break;
                case "7_jingjialiebiao":
                    setUrlMapData("BidListon", entity);
                    break;
                case "7_xiangmuguanli"://项目管理
                    ProjectIssueListActivity.start(context);
                    break;
                case "7_xuqiuguanli"://需求管理
                    DemandIssueListActivity.start(context);
                    break;
                case "7_paimaifabu"://拍卖发布
                    AuctionPublishActivity.start(context);
                    break;
                case "7_paimaiguanli"://拍卖管理
                    AuctionManageActivity.start(context);
                    break;
                case "7_jingmaichaxun"://竞买查询
                    BiddingQueryActivity.start(context);
                    break;
                case "7_zhuanjiaku":
                    int comType = SharedPreferenceUtil.getInstance().getSaveIntData(SharedPreferenceUtil.COM_TYPE, 0);
                    if (comType == 1) {
                        PickExpertListActivity.start(context);
                    }
                    break;
                    /*
                    工程工队
                     */
                case "5_gongchenggongdui":
                case "5_gongduijianjie":
                case "5_gongzhongbaojia":
                case "5_gongchengyeji":
                case "5_zhuanyerenyuan":
                case "5_zhuanyeshebei":
                case "5_gongduixiangce":
                case "5_xuqiuxinxi":
                case "5_gongrenfabu":
                case "5_banzuzhang":
                case "5_linghuoyonggong":
                case "5_yonggongbaoming":
                    teamCheck(entity.getName(),context);
                    break;
                case "5_jigongjizhang":
                    if (!TextUtils.isEmpty(SharedPreferenceUtil.getInstance().getSaveStringData(SharedPreferenceUtil.LOGIN_TOKEN, ""))){
                        com.swgk.core.common.utils.ActivityJump.startActivity(PathTeam.AddProjectActivity);
                    }else {
                        com.swgk.core.common.utils.ActivityJump.startActivity(PathLogin.VerificationCodeLoginActivity);
                    }
                    break;
                  /*
                  集采管理
                   */
                case "8_wodejicai"://我的集采-需方发起
//                    SelfPickListActivity4.start(context, 1);
                    MyCenterXuFangFaQiActivity.start(context, "1");
                    break;
                case "8_wodejiameng"://我的加盟
//                    SelfPickListActivity4.start(context, 2);
                    MyCenterMyJoinActivity.start(context);
                    break;
                case "8_wodebaojia"://我的报价
                    JcMyPriceActivity.start(context);
                    break;
                case "8_changjiajicai": // 2020年12月28日   厂家集采  供方发起
                    FactoryJicaiActivity.start(context);
                    break;
                case "8_baojiajiyu"://报价机遇
                    JcChanceListActivity.start(context, 1);
                    break;
                case "8_jiamengjiyu"://加盟机遇
                    JcChanceListActivity.start(context, 2);
                    break;
                case "8_wodejiandu"://我的监督
                    MyJicaiSupervisionActivity.start(context);
                    break;
                case "8_qiyezhuanxiang"://企业专项
                    MyCenterXuFangFaQiActivity.start(context, "2");
                    break;
                case "20_caigoudingdan":
                    com.swgk.core.common.utils.ActivityJump.startActivity(PathHome.PurchaseOrderListActivity);
                    break;

                case "20_xiaoshoudingdan":
//                    ARouter.getInstance().build(PathHome.SaleOrderListActivity).navigation();
                    com.swgk.core.common.utils.ActivityJump.startActivity(PathHome.SaleOrderListActivity);
                    break;
                //物流运输（货车管理）
                case "22_chezhubaojia":
//                    MyOfferAndOrderActivity.start(context);
                    MyOfferActivity.start(context);
                    break;
                case "22_jingjiadingdan":
                    BiddingOrderActivity.start(context, false);
                    break;
                case "22_cheduiguanli"://车队管理
                    FleetManagementActivity.start(context, true);
                    //AffiliatedFleetDetailsActivity.start(context,true);
                    break;
                case "22_sijiguanli"://司机管理
                    ARouter.getInstance().build(PathDriver.ProprietaryDriverActivity)
                            .navigation(context);
                    break;
                case "22_cheliangguanli"://车辆管理
                    SelfCarManagerActivity.start(context);
                    break;
                case "21_huochefabu":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        AddCarActivity.start(context, true);
                    }
                    break;
                case "22_huochefabu":
                    AddSelfCarActivity.start(context, true);
                    break;

                case "21_cheliangguanli":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        CarManagerActivity.start(context);
                    }
                    break;
                case "21_chengyunguanli":
                    if (UserOperating.getInstance().isAuthRealName()) {
                        if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                            CarriageManageActivity.start(context);
                        }
                    } else {
                        new RoundDialog.Builder(context)
                                .title("提示")
                                .content("您当前未实名认证，是否立即认证？")
                                .cancel("取消")
                                .confirm("去认证")
                                .cancelable(false)
                                .confirmCallback(v -> {
                                    AuthActivity3.start(context);
                                })
                                .show();
                    }
                    break;
                case "22_chengyunguanli":
                    if (UserOperating.getInstance().isAuthRealName()) {
                        CarriageManageActivity.start(context);
                    } else {
                        new RoundDialog.Builder(context)
                                .title("提示")
                                .content("您当前未实名认证，是否立即认证？")
                                .cancel("取消")
                                .confirm("去认证")
                                .cancelable(false)
                                .confirmCallback(v -> {
                                    AuthActivity3.start(context);
                                })
                                .show();
                    }
                case "21_huozhuxunjia":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        OwnerAndDriverInquiryActivity.start(context, false);
                    }
                    break;
                case "22_huozhuxunjia":
                    OwnerAndDriverInquiryActivity.start(context, false);
                    break;
                case "21_huoyundingdan":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        TransportOrderDriverActivity.start(context);
                    }
                    break;
                case "22_huoyundingdan":
                    TransportOrderDriverActivity.start(context);
                    break;
                case "21_chezhubaojia":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        MyOfferActivity.start(context);
                    }
                    break;
                case "21_huoyuandingyue":
                    if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                        BusinessOpportunitySubscriptionActivity.start(context);
                    }
                    break;
                case "22_huoyuandingyue":
                    BusinessOpportunitySubscriptionActivity.start(context);
                    break;
                case "21_changpaochengshi":
                    MainCitiesActivity.start(context);
                    break;
                case "21_jingjiadingdan":
                    BiddingOrderActivity.start(context, false);
                    break;
                case "21_chengyunfabu":
                    if (UserOperating.getInstance().isAuthRealName()) {
                        if (!UserOperating.getInstance().hasNotDriverPermission(context)) {
                            ARouter.getInstance().build(PathLogistics.CarriagePushActivity).navigation();
                        }
                    } else {
                        new RoundDialog.Builder(context)
                                .title("提示")
                                .content("您当前未实名认证，是否立即认证？")
                                .cancel("取消")
                                .confirm("去认证")
                                .cancelable(false)
                                .confirmCallback(v -> {
                                    AuthActivity3.start(context);
                                })
                                .show();
                    }
                    break;
                case "22_chengyunfabu":
                    ARouter.getInstance().build(PathLogistics.CarriagePushActivity).navigation();
                    break;
                //物流运输（中介/企业）
                case "19_huoyuanguanli":
                    CargoManageActivity.start(context, true);
                    break;
                case "19_huochebaoming":
                    TruckRegisterActivity.start(context, true);
                    break;
                case "19_huoyundingdan":
                    TransportOrderOwnerActivity.start(context);
                    break;
                case "19_chengyunshangji":
                    FreightCarTransportationActivity.start(context, true);
                    break;
                case "19_wodexunjia":
                    OwnerAndDriverInquiryActivity.start(context, true);
                    break;
                case "19_jingjiadingdan":
                    BiddingOrderActivity.start(context, true);
                    break;
                case "19_jingjiafabuwuliu":
                    PublishCargoActivity.start(context, false);
                    break;
                case "19_huoyunfabu":
                    PublishCargoActivity.start(context, true);
                    break;
                /*
                 * 会员经营
                 */
                case "14_xufanghuiyuan": // 需方会员
                    MemberManageActivity.start(context, 0, true, true);
                    break;
                case "14_gongfanghuiyuan": // 供方会员
                    MemberManageActivity.start(context, 1, true, true);
                    break;
                case "14_huiyuanguanli": // 会员管理
                    MemberManageActivity.start(context, 0, true);
                    break;
                case "14_yaoqingguanli": // 邀请管理
                    MemberInviteOrApplyActivity.startInviteOrApplyRecord(context, 0);//0邀请
                    break;
                case "14_shenqingguanli": // 申请管理
                    MemberInviteOrApplyActivity.startInviteOrApplyRecord(context, 1);//1申请
                    break;
                case "14_pingjishenhe": // 评级审核-会员审核
                    MemberAuditActivity.start(context);
                    break;
                case "14_biaozhunsheding": // 标准设定\评级规则
                    MemberLeverSettingActivity.start(context);
                    break;
                case "14_kehuguanli": // 客户管理
                    MemberClientManageActivity.start(context);
                    break;
                case "14_pingjiyewu": // 评级业务
                    RatingBusinessActivity.start(context);
                    break;
                case "14_huiyuanmenkan": // 会员门槛
                    MemberDoorActivity.Companion.jumptToAct((Activity) context);
                    break;
                case "14_yaoqinghuiyuan"://邀请会员
                    MemberInviteOrApplyActivity.startManage2(context, 0);//0邀请
                    break;
                case "14_shenqinghuiyuan"://申请会员
                    MemberInviteOrApplyActivity.startManage2(context, 1);//1申请
                    break;
                case "14_yijiechuhuiyuan"://已解除会员
                    RemoveMemberActivity.Companion.jumptAct(context);
                    break;


                /**
                 * 网站建设
                 */
                case "15_hanxunshezhi": // 函询设置
                case "15_kefushezhi": // 客服设置
                    ToastUtil.show(context,"开发中···");
                    break;
                case "15_qiyexiangce": // 宣传相册
                case "0_qiyexiangce":
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.QIYEXIANGCE);
                    break;
                case "15_qiyexinxi": // 信息填写
                    if (companyType == 0) {
                        WebsiteMyXiXinActivity.start(context);
                    } else if (companyType == 1) {
                        WebsiteQiYeXiXinActivity.start(context, WebsiteReleaseActivity.QIYEXINXI);
                    } else if (companyType == 2) {
                        WebSiteGroupActivity.Companion.start(context);
                    } else if (companyType == 3) {
                        WebsiteOrganizationActivity.Companion.launch(context);
                    }
                    break;
                case "15_qiyezizhi":
                case "0_qiyezizhi":// 专项资质
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.QIYEZIZHI);
                    break;
                case "15_yejizhengming":
                case "0_yejizhengming":// 经营业绩
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.YEJIZHENGMING);
                    break;
                case "15_qiyedongtai":
                case "0_qiyedongtai":// 经营动态
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.QIYEDONGTAI);
                    break;
                case "15_zhishichanquan":
                case "0_zhishichanquan":// 知识产权
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.ZHISHICHANQUAN);
                    break;
                case "15_hangyerongyu":
                case "0_hangyerongyu": // 荣誉荣耀
                    WebsiteReleaseActivity.start(context, WebsiteReleaseActivity.HANGYERONGYU);
                    break;
                    /*
                    t团队管理
                     */
                case "16_wodetuandui":
                    SelfTeamActivity.start(context);
                    break;
                  /*
                  企业设置
                   */
                case "18_renzhengzhongxin":
                    //认证中心
                    AuthActivity3.start(context);
                    break;
                case "19_jibenxinxi":
                case "0_wodexinxi":
                    //基本信息
                    PersonInfoActivity.start(context, new ArrayList<CompanyEntity>());
                    break;
                case "19_jiaruqiye":
                    //加入企业
                    JoinCompanyActivity.start(context);
                    break;
                case "20_tuanduixinxi":
                    //团队信息
                    TeamFunctionActivity.start(context, entity.getId());
                    break;
                case "20_wuliuzhongjie":
                    //物流中介
                    LogisticsMenuActivity.start(context);
                    break;
                //审批
                case "1_daibanshixiang":
                    ApprovalManagerActvity.start(context, 0);
                    break;
                case "2_wofaqi":
                    ApprovalManagerActvity.start(context, 1);
                    break;
                case "3_yishenpi":
                    ApprovalManagerActvity.start(context, 2);
                    break;
                case "4_chaosongwo":
                    ApprovalManagerActvity.start(context, 3);
                    break;
                case "common_jibenxinxi":
                    //基本信息
                    PersonInfoActivity.start(context, new ArrayList<CompanyEntity>());
                    break;
                case "common_jiaruqiye":
                    //加入企业
                    JoinCompanyActivity.start(context);
                    break;
                case "common_renzhengzhongxin":
                    //认证中心
                    AuthActivity3.start(context);
                    break;
                case "common_wodexunjia"://我的询价
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    ARouter.getInstance().build(Constants.ARouter.PERSONAL_MY_INQUIRY).navigation();
                    break;
                case "common_hanxunhuifu"://我的函询
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    LetterBackActivity.start(context);
//                    LeaseMyInquiryActivity.start(context);
                    break;
                case "common_wodepingbiao"://我的评标
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    setUrlMapData("bidEvaluation", entity);
                    break;
                case "common_zigeshencha"://资格审查
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    setUrlMapData("prequalification", entity);
                    break;
                case "7_baozhengjindingdan"://保证金订单
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    setUrlMapData("bondList", entity);
                    break;
                case "common_zijinzhongxin"://资金中心
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    CapitalActivity.start(context, true);
                    break;
                case "common_jubaojiandu"://我的举报
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    MonitoringReportActivity.start(context);
                    break;
                case "common_zhinengguanzhu":////智能关注
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    IntelligentAttentionActivity.start(context);
                    break;
                case "17_guanzhudegongdui":
                    if (!SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ACAdminDialogUtils.showACDialog(ACAdminDialogUtils.TYPE_AUTH_NO_AC, context);
                        return;
                    }
                    IntelligentAttentionActivity.start(context, 5);
                    break;
                //团队常用功能
                case "0_tuanduizizhi"://团队资质
                    ActivityJump.jumpToActivity(context, TeamIntelligenceListActivity.class, Pair.create("teamNo", ""), Pair.create("isUserCenter", true));
                    break;
                case "0_fuwuanli"://服务案例
                    ActivityJump.jumpToActivity(context, ServiceQuoteListActivity.class, Pair.create("isUserCenter", true));
                    break;
                case "0_youxiurencai"://优秀人才
                    ActivityJump.jumpToActivity(context, TalentListActivity.class, Pair.create("isUserCenter", true));
                    break;
                case "0_tuanduixinxi"://团队信息
                    ActivityJump.jumpToActivity(context, UserCenterTeamDetailActivity.class);
                    break;
                case "0_tuanduixiangce"://团队相册
                    ActivityJump.jumpToActivity(context, ProfessionalTeamPictureActivity.class, Pair.create("isUserCenter", true));
                    break;
                case "0_renzhengzhongxin"://认证中心
                    AuthActivity3.start(context);
                    break;
                //region 资金中心
                case "8_daifuzhangdan":
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGDAN, 1);
                    break;
                case "8_yifuzhangdan":
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGDAN, 2);
                    break;
                case "8_yingshouzhangdan":
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGDAN, 3);
                    break;
                case "8_yishouzhangdan":
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGDAN, 4);
                    break;
                case "0_qianbao":
                case "23_qianbao"://钱包
                    CapitalActivity.start(context, true);
                    break;
                case "0_caiwuzhongxin"://财务中心
                case "8_caiwuzhongxin"://财务中心
                    CapitalActivity.start(context, false);
                    break;
                case "1_daifudingdan"://待付订单
                case "8_daifudingdan"://待付订单
                    UiUtil.sendMsg(EventConstant.EVENT_DAIFUDINGDAN, false);
                    break;
                case "2_yuetixian"://余额提现
                case "8_yuetixian"://余额提现
                    UiUtil.sendMsg(EventConstant.EVENT_YUETIXIAN, false);
                    break;
                case "3_zhanghumingxi"://账户明细
                case "8_zhanghumingxi"://账户明细
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGHUMINGXI, false);
                    break;
                case "4_yinhangka"://银行卡
                case "8_yinhangka"://银行卡
                    UiUtil.sendMsg(EventConstant.EVENT_YINHANGKA, false);
                    break;
                case "5_feiyongchaxun"://费用查询
                case "8_feiyongchaxun"://费用查询
                    UiUtil.sendMsg(EventConstant.EVENT_FEIYONGCHAXUN, false);
                    break;
                case "6_renzhengziliao"://认证资料
                case "8_renzhengziliao"://认证资料
                    UiUtil.sendMsg(EventConstant.EVENT_RENZHENGZILIAO, companyType == 0);
                    break;
                case "7_zhangwuliushui"://账务流水
                case "8_zhangwuliushui"://账务流水
                    UiUtil.sendMsg(EventConstant.EVENT_ZHANGWULIUSHUI, false);
                    break;
                case "8_yuechongzhi":
                    UiUtil.sendMsg(EventConstant.EVENT_YUECHONGZHI, false);
                    //余额充值
                    break;
                case "8_tuikuanliebiao":
                    // 退款列表
                    UiUtil.sendMsg(EventConstant.EVENT_TUIKUANLIEBIAO, false);
                    break;
                // 开票记录
                case "9_kaipiaojilu":
                case "8_fapiaoliebiao":
                    UiUtil.sendMsg(EventConstant.EVENT_KAIPIAOJILU, false);
                    //余额充值
                    break;
                case "8_zaixianzhuanzhang":
                    // 在线转账
                    UiUtil.sendMsg(EventConstant.EVENT_ZAIXIANZHUANZHUANG, false);
                    break;
                //endregion 资金中心
                case "20_zhuanrangfabu"://转让发布
                    if (SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ActivityJump.jumpToActivity(context, MakeOverPublishMainActivity.class, Pair.create("position", 0));
                    } else {
                        com.sgb.kjwl.utils.DialogHelper.showDialog(context, "温馨提示", "请先进行实名认证", "确定", new DialogFunction() {
                            @Override
                            public void normalRoundDialog() {
                                CertificationActivity.start(context, "1");
                            }
                        });
                    }
                    break;
                case "20_fuwufabu"://服务发布
                    if (SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        ActivityJump.jumpToActivity(context, PublishServiceListActivity.class);
                    } else {
                        com.sgb.kjwl.utils.DialogHelper.showDialog(context, "温馨提示", "请先进行实名认证", "确定", new DialogFunction() {
                            @Override
                            public void normalRoundDialog() {
                                CertificationActivity.start(context, "1");
                            }
                        });
                    }
                    break;
                case "20_xuqiufabu"://需求发布
                    if (SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        AddNeedListActivity.startactivity(context);
                    } else {
                        com.sgb.kjwl.utils.DialogHelper.showDialog(context, "温馨提示", "请先进行实名认证", "确定", new DialogFunction() {
                            @Override
                            public void normalRoundDialog() {
                                CertificationActivity.start(context, "1");
                            }
                        });
                    }
                    break;
                case "20_wodebaojia"://我的报价
                    if (SharedPreferenceUtil.getInstance().getSaveBooleanData(SharedPreferenceUtil.PERSON_AUTH, false)) {
                        MySignUpListActivity.start(context);
                    } else {
                        com.sgb.kjwl.utils.DialogHelper.showDialog(context, "温馨提示", "请先进行实名认证", "确定", new DialogFunction() {
                            @Override
                            public void normalRoundDialog() {
                                CertificationActivity.start(context, "1");
                            }
                        });
                    }
                    break;
                case "20_lianxirenguanli"://联系人管理
                    ContanctsActivity.startactivity(context);
                    break;
//                case "20_caigoudingdan"://采购订单
//                    MToast.showToast(context, "该功能正在建设中，请前往PC端查看！");
//                    break;
//                case "20_xiaoshoudingdan"://销售订单
//                    MToast.showToast(context, "该功能正在建设中，请前往PC端查看！");
//                    break;
                case "18_dizhiguanli"://个人、企业--地址管理
                    WebSiteAddressActivity.Companion.launch(context, companyType);
                    break;
                //招商引资
                case "23_touzixiangmuguanli"://投资项目管理
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.SelfProjectListActivity).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再查看");
                    }
                    break;
                case "23_fabutouzixiangmu"://发布投资项目
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.InvestmentPublishActivity).withBoolean(RouterKey.BOOLEAN2, true).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再发布");
                    }
                    break;
                case "23_wodebaoming"://我的报名
                    ARouter.getInstance().build(PathMerchant.SelfApplyActivity).navigation();
                    break;
                case "23_fabutouzixuqiu"://发布投资需求
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.PublishDemandActivity).withBoolean(RouterKey.BOOLEAN2, true).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再发布");
                    }
                    break;
                case "23_touzixuqiuguanli"://投资需求管理
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.SelfDemandListActivity).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再查看");
                    }
                    break;
                case "23_fabuchanyeyuanqu"://发布产业园区
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.ActivityPublishParks).withBoolean(RouterKey.BOOLEAN2, true).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再发布");
                    }
                    break;
                case "23_chanyeyuanquguanli"://产业园区管理
                    if (companyType != 1) {
                        ARouter.getInstance().build(PathMerchant.SelfIndustryListActivity).navigation();
                    } else {
                        MToast.showToast(context, "请您将身份切换为组织后再查看");
                    }
                    break;

                //合同
                case "18_hetongliebiao"://合同列表
                    UiUtil.sendMsg(EventConstant.HE_TONG_LIE_BIAO, false);
                    break;
                case "18_kaihuziliao"://开户资料
                    UiUtil.sendMsg(EventConstant.KAI_HU_ZI_LIAO, false);
                    break;
                case "7_yaoqingbaoming":
                    PickInvitedApplyListActivity.start(context, "1");
                    break;
                case "7_yaoqingjingjia":
                    PickInvitedApplyListActivity.start(context, "2");
                    break;
                //食住行
                case "19_jipiaodingdan"://机票订单
                    ARouter.getInstance().build(PathTrip.FlightOrdersSelfActivity).navigation();
                    break;
                case "20_wodezuzhi":
                    //我的组织
                    PersonInfoActivity.start(context, new ArrayList<CompanyEntity>(),1);
                    break;
                default:
                    MenuClickUtils.getInstance().handlerSelfMenu(context, companyType, entity);

            }

        }
    }
    /**
     * 功能模块跳转H5之前请求跳转链接
     *
     * @param tagURl 需要方位的请求链接标识
     * @param entity 当前板块数据实体
     */
    public void setUrlMapData(String tagURl, PermissionMenuEntity.ListEntity entity) {
        Map<String, String> map = new HashMap<>();
        String typeUrl = "";
        if (entity.getName().contains("2")) { //个人
            typeUrl = "";
        } else if (entity.getName().contains("3")) { //商品 ?type=3
            typeUrl = "?type=3";
        } else if (entity.getName().contains("4")) {//租赁 ?type=1
            typeUrl = "?type=1";
        } else if (entity.getName().contains("5")) {//工程 ?type=2
            typeUrl = "?type=2";
        } else if (entity.getName().contains("7")) {//招采 ?type=2
            // 0--个人 1--企业 2--团队 3--组织
            int comType = SharedPreferenceUtil.getInstance().getSaveIntData(SharedPreferenceUtil.COM_TYPE, 0);
            if (comType == 0) {
                typeUrl = "";
            } else if (comType == 1) {
                typeUrl = "?type=4";
            }
        }
        map.put("type", tagURl);
        map.put("typeUrl", typeUrl);
        map.put("name", entity.getName());
        urlMapDataCallBack.OnUrlMapDataCallBacklistener(map,from);
//        model.getStringUrl(context,map);
    }
    public void setOnOnUrlMapDataCallBacklistener(UrlMapDataCallBack urlMapDataCallBack){
        this.urlMapDataCallBack =urlMapDataCallBack;
    }
    public interface UrlMapDataCallBack{
        void OnUrlMapDataCallBacklistener( Map<String, String> map,String from );
    }

    @LoginCheck(needRealName = true)
    public void teamCheck(String name,Context context){
        if (SharedPreferenceUtil.getInstance().getSaveIntData(SharedPreferenceUtil.COM_TYPE, 0) != 3){
            switch (name){
                case "5_gongchenggongdui":
                    SelfPackersManageActivity2.start(context);
                    break;
                case "5_gongduijianjie":
                    SelfTeamIntroduceEditActivity.start(context);
                    break;
                case "5_gongzhongbaojia":
                    SelfTeamOfferActivity.start(context);
                    break;
                case "5_gongchengyeji":
                    SelfTeamAchieveActivity.start(context);
                    break;
                case "5_zhuanyerenyuan":
                    SelfTeamMembersActivity.start(context);
                    break;
                case "5_zhuanyeshebei":
                    SelfTeamDeviceActivity.start(context);
                    break;
                case "5_gongduixiangce":
                    SelfTeamAlbumActivity.start(context);
                    break;
                case "5_xuqiuxinxi":
                    ActivityJump.jumpToActivity(context, LaborServiceAndEmploymentPublishListActivity.class);
                    break;
                case "5_gongrenfabu":
                    SelfWorkerPublishActivity.start(context);
                    break;
                case "5_banzuzhang":
                    SelfTeamGroupActivity.start(context);
                    break;
                case "5_linghuoyonggong":
                    SelfTeamEmploymentActivity.start(context);
                    break;
                case "5_yonggongbaoming":
                    SelfEmploymentApplyActivity.start(context);
                    break;
                default:
                    break;
            }
        }
    }
}
